Oryginalny wykres

OrginalPlot Źródło: https://www.reddit.com/r/dataisbeautiful/comments/11u5wn6/oc_the_cost_of_cable_vs_top_streaming/

Poprawiony wykres

Kod w R:

library(dplyr)
library(ggplot2)
# przygotowujemy ramki danych + inne rzeczy których użyjemy do wykresu

### PREVIOUSLY USED DF ###

#df <- data.frame("streaming_subscriptions" = c("discovery+","AppleTv","Prime video", "peacock", "Paramount+", "Netflix", "HBO MAX", "Disney+"),
#                 "Cost" = c(6.99, 6.99, 8.99, 9.99, 9.99, 9.99, 15.99, 19.99))


#df2 <- data.frame("Cable_package" = c("Verizon - The Most Fios TV", "DirecTV - PREMIER All-Included", "Dish - America's Top 200", "Spectrum - Spectrum TV® Select", 
#                                      "Cox - Contour TV Starter" , "Xfinity - Popular TV"),
#                  "Cost" = c(110, 154.99, 99.99, 59.99, 53, 50)) %>% 
#  arrange(desc(Cost))

### FINAL DF ###

df_final <- data.frame("Sources" = c( c("discovery+","AppleTv","Prime video", "peacock", "Paramount+", "Netflix", "HBO MAX", "Disney+"),
                               c("Verizon - The Most Fios TV", "DirecTV - PREMIER All-Included", "Dish - America's Top 200", "Spectrum - Spectrum TV® Select", 
                                      "Cox - Contour TV Starter" , "Xfinity - Popular TV")),
                 "Cost" = c(c(6.99, 6.99, 8.99, 9.99, 9.99, 9.99, 15.99, 19.99),c(110, 154.99, 99.99, 59.99, 53, 50)),
                 "Type" = c(rep("Streaming Subscriptions", 8), rep("Cable Package", 6)))

### UNUSED DATA ###

#mean_streaming <- df_final %>% 
#  filter(Type == "Streaming Subscriptions") %>% 
#  summarise(mean = mean(Cost))

#mean_cable <- df_final %>% 
#  filter(Type == "Cable Package") %>% 
#  summarise(mean = mean(Cost))

#mean_cable_overall <- 83
ggplot(data = df_final, mapping = aes(x = Cost, y =reorder(Sources, -Cost), fill = Type)) +
  geom_bar(stat="identity") +
  labs(title = "The Cost Of Most Popular Cable Packages Vs. \n The Cost of TopStreaming Subsciptions",
       subtitle = "(as of 2023)",
       x = "Cost (in US dollars)",
       y = "CablePackages and Streaming Services") +
  theme_minimal()+
  theme(plot.title = element_text(hjust = 0.5), 
        plot.subtitle = element_text(hjust = 0.5),) #+

  #geom_vline(xintercept = mean_streaming$mean, col = "red")+
  #geom_vline(xintercept = mean_cable$mean, col = "orange") +
  #geom_vline(xintercept = mean_cable_overall, col = "black")


#  labs(title = "The Cost Of Cable vs The Cost of TopStreaming Subsciptions")

Dlaczego nowy wykres jest lepszy? - Uzasadnienie

Lista powodów, dla których nowy wykres jest lepszy od poprzedniego:

Bibliografia

Do ulepszenia wykresu zostały użyte dane z następujących stron: